import secondConfigService from './second.service.js'

// 第二台服务器请求方法
const secondRequest = (options) => {
  return new Promise((resolve, reject) => {
    uni.request({
      url: config.secondBaseURL.prod + options.url,
      method: options.method || 'GET',
      data: options.data,
      header: options.header || {
        'Content-Type': 'application/json'
      },
      success: (res) => {
        resolve(res.data)
      },
      fail: (err) => {
        reject(err)
      }
    })
  })
}

export default secondRequest